<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
      .tag-success{
        display: inline-block;
        padding:10px 30px;
        border:1px solid green;
      }
      .tag-danger{
        display: inline-block;
        padding:10px 30px;
        border:1px solid red;
      }
    </style>
</head>

<body>
    <div id="app">
     <el-table :data="list">
       <template slot-scope="scope">
         <i class="tag-success" v-if="scope.row.status==true">成功</i>
         <i class="tag-danger" v-else>失败</i>
       </template>
     </el-table>
    </div>
    <script src="js/vue.js"></script>
    <script>
        Vue.component('el-table',{
          props:['data'],
          template:`
            <table>
              <tr v-for="(item,index) in data" :key="item.id">
                <td>{{item.id}}</td>
                <td>{{item.age}}</td>
                <td><slot :row="item"></slot></td>
              </tr>  
            </table>
          `
        })
        var vm = new Vue({
            el: '#app',
            data: {
              list:[
                {id:1,name:'小明',age:20,status:true},
                {id:2,name:'小王',age:21,status:false},
                {id:3,name:'小马',age:22,status:true},
                {id:4,name:'小刘',age:23,status:false},
              ]
            },
            methods: {}
        });
    </script>
</body>

</html>